package com.blue.test;

import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Page;

public class CarOffController extends Controller {
	@ActionKey(value = "getCarOff")
	
	public void index() {
		int pageIndex = getParaToInt("pageIndex", 1);
		int pageSize = getParaToInt("pageSize", 10);
		Page<CarOff> userPage = CarOff.dao.paginate(pageIndex,
				pageSize, "select * ", " from caroff ");
		renderJson(userPage);

		// List<NewsImportant> list = NewsImportant.dao
		// .find("select * from newsimportant");
		// renderJson(list);
	}

	// 要闻按页获取
	public void getNewsInportant() {

		int pageIndex = getParaToInt("pageIndex", 1);
		int pageSize = getParaToInt("pageSize", 20);
		Page<NewsImportant> userPage = NewsImportant.dao.paginate(pageIndex,
				pageSize, "select *", "from newsimportant order by id sec");
		renderJson(userPage);
	}

	

}
